Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

31 create a method to record the simulation #32

Merged
merged 22 commits into from
Jun 4, 2024

Conversation

ll7
Copy link
Owner

@ll7 ll7 commented Jun 4, 2024

look at test_pygame/test_load_and_visualize_states.py for implementation details.

ll7 added 22 commits June 3, 2024 13:41
This commit adds the ability to record the current state of the environment during simulation. It introduces the `recording_enabled` parameter to the `RobotEnv` class, which when set to `True`, enables recording of states. The recorded states are stored in a list and can be saved to a file using the `save_recording()` method. Additionally, the `reset()` method now checks if recording is enabled and saves the recording before resetting the state list.
This commit adds a test for the recording functionality in the `RobotEnv` class. The test ensures that the recording is created and saved correctly, and that the recorded states are instances of `VisualizableSimState`.
This commit adds a README.md file explaining the purpose of the Pygame specific test and why it cannot be run in the CI environment. The README.md file provides context for developers who encounter the test and clarifies that it is meant to be run locally.
This commit adds a test case to verify the functionality of loading and visualizing recorded states in the `test_load_and_visualize_states` module. The test creates a temporary file, saves a list of `VisualizableSimState` instances to the file using pickle, loads the states from the file, and checks if the loaded states match the original states. Additionally, the commit demonstrates how to use the `visualize_states` function. The temporary file is deleted after the test.
This commit modifies the `RobotEnv` class in `demo_offensive.py` to enable the recording of states during simulation. The `recording_enabled` parameter is added to the `RobotEnv` constructor, allowing the recording of states when set to `True`. Additionally, the `reset()` method now saves the recording before resetting the state list. This change enhances the functionality of the `RobotEnv` class by providing the ability to record and save simulation states.
@ll7 ll7 linked an issue Jun 4, 2024 that may be closed by this pull request
@ll7 ll7 marked this pull request as ready for review June 4, 2024 09:01
@ll7 ll7 merged commit 99fc171 into main Jun 4, 2024
1 check failed
@ll7
Copy link
Owner Author

ll7 commented Jun 4, 2024

What needs to be improved is that during playback it is not possible to move the camera.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a method to record the simulation
1 participant